﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MuaChung.Models.CouponDetail>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <link href="/Content/CouponDetail.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/LiteDialog.js" type="text/javascript"></script>
    <script type="text/javascript">
        function Buy(ma,id) {
            $.get("/Coupon/OrderDialog?maCoupon=" + ma + "&cid=" +id, function (data, textStatus, jqXHR) {
                $.liteDialog({ html: data, modal: true });
            });
            setTimeout(function () {
                $.liteDialog('hide');
            }, 10000);
        }
    </script>
    <div class="div_LMainInfo">
        <div class="div_TopLInfoMC">
            <i class="div_LTopInfo"></i>
            <div class="div_LBodyInfo">
                <i class="div_LBodyTop"></i>
                <div class="div_TextInfoDay">
                    <h2 id="hTitleDeal" class="styleText3" style="font-size: 19px">
                        <p>
                            <%if (Model.doanhNghiep != null)
                              {%>
                            <%:Model.doanhNghiep.Ten_DoanhNghiep%>
                            <%}
                              else
                              {%>
                            Hot Mỗi Ngày
                            <%} %>
                            :<%:Model.tenSP%>
                            giá
                            <%:(int)Model.giaGoc%>
                            VND giờ chỉ còn
                            <%:(int)Model.giaTot %>
                            VND tiết kiệm được
                            <%:(int)Model.tyLeGiam%>
                            %. Chỉ có tại HOT MỖI NGÀY CỦA CHÚNG TÔI!</p>
                    </h2>
                </div>
                <div class="div_InfoProduct">
                    <div class="div_LInfoGroupOn">
                        <p class="div_FillBgGroupOn">
                        </p>
                        <div class="div_bgGroupOn ">
                            <div class="div_TietKiem" id="divTietKiem">
                                <strong class="styleText4">Tiết Kiệm</strong><br>
                                <strong class="safeUp">
                                    <%: (int)Model.tyLeGiam %>%</strong></div>
                            <div class="divPrice" id="divPriceDown">
                                <span class="styleText4">Giá trị:<strong class="StyleTextGT lineHorizontal styleText2"><%:(int)Model.giaGoc%></strong></span><div
                                    class="div_VND GTVND">
                                    <strong class="styleText13">VND</strong></div>
                                <br>
                                <span class="styleText4 spTietKiem">Tiết kiệm:<strong class="StyleTextGT styleText2"><%:(int)(Model.giaGoc-Model.giaTot) %></strong></span><div
                                    class="div_VND TKVND">
                                    <strong class="styleText13">VND</strong></div>
                            </div>
                            <div style="height: 73px;" id="divPrice">
                                <div class="div_infoMoney">
                                    <div class="div_TextInfoMoney">
                                        <p class="styleText7">
                                            <strong>Còn Lại</strong><strong class="strVNDMoney">VND</strong></p>
                                        <p class="pGiaTienID">
                                            <strong class="safeUp">
                                                <%:(int)Model.giaTot%></strong></p>
                                    </div>
                                    <div id="divBuy">
                                        <div class="div_buttonMua">
                                            <%if (Model.tgKetThuc >= DateTime.Now && Model.soLuongDatHang < Model.soLuongCoupon)
                                              {%>
                                            <a id="btnBuyDeal" class="btnMua" style="display: block;" href="javascript:Buy('<%: Model.maCoupon %>','<%: Model.cid %>')">
                                            </a>
                                            <%}
                                              else
                                              {%>
                                            <div id="divBuy">
                                                <div class="div_buttonHetHan">
                                                </div>
                                            </div>
                                            <% }%></div>
                                    </div>
                                </div>
                            </div>
                            <div class="div_MuaTangBB">
                                <p>
                                    <img src="/Content/Images/Backgrounds/bg_index1.jpg" width="70px" height="60px" /></p>
                                <p class="aTextQuaTang">
                                    Hợp tác & phát triển</p>
                            </div>
                        </div>
                        <!--Div Time ConLai-->
                        <div id="divRemainTime">
                            <div class="div_TimeCLMC">
                                <div class="div_LeftTimeCLMC">
                                </div>
                                <div class="div_CenterTimeCLMC">
                                    <p class="pTimeCLNew styleText2">
                                        <strong>Thời gian còn lại:</strong></p>
                                    <div id="BuyerHours" class="div_bgEachTime firstEachTime">
                                        <strong class="safeUp">39</strong></div>
                                    <div id="BuyerMins" class="div_bgEachTime">
                                        <strong class="safeUp">59</strong></div>
                                    <div id="BuyerSecs" class="div_bgEachTime">
                                        <strong class="safeUp">5</strong></div>
                                    <p class="p_bgEachTime firstEachTime styleText8 color4">
                                        giờ</p>
                                    <p class="p_bgEachTime styleText8 color4">
                                        phút</p>
                                    <p class="p_bgEachTime styleText8 color4">
                                        giây</p>
                                </div>
                                <div class="div_RightTimeCLMC">
                                </div>
                            </div>
                            <div class="div_StatusMC">
                                <div class="div_LStatusMC">
                                </div>
                                <div class="div_BStatusMH divBStatusHH">
                                    <span class="spCheckHH"></span>
                                    <p class="pBuyerMH styleText7">
                                        Có <strong class="styleText15">
                                            <%:Model.soLuongDatHang %></strong> người mua<br />
                                        <%if (Model.soLuongCanMua > Model.soLuongDatHang)
                                          {%>
                                        Chưa đạt được giá tốt.
                                        <%}
                                          else
                                          {%>
                                        Đã đạt được Giá tốt!
                                        <% } %>
                                        <%if (Model.soLuongCoupon > Model.soLuongDatHang)
                                          {%>
                                        <br />
                                        Vẫn còn mua được...
                                        <%}
                                          else
                                          {%>
                                        Rất tiếc, chờ cơ hội lần sau.
                                        <% }%>
                                    </p>
                                </div>
                                <div class="div_RStatusMC">
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--END DIV LEFT Info Group On-->
                    <!--DIV Rignt info Product-->
                    <%string p = "";
                      int numImg = 0;
                      string firstP = "";
                      if (Model.hinhAnh.Count > 0)
                      {
                          for (int i = 0; i < Model.hinhAnh.Count; i++)
                          {
                              if (i == Model.hinhAnh.Count - 1)
                              {
                                  p += Model.hinhAnh[i].URL;
                              }
                              else
                              {
                                  p += Model.hinhAnh[i].URL + ";";
                              }
                          }
                          firstP = Model.hinhAnh[0].URL;
                          numImg = Model.hinhAnh.Count;
                      }
                      else
                      {
                          p += "/Content/CouponImages/default.jpg";
                          firstP = p;
                          numImg = 1;
                      }%>
                    <script type="text/javascript">
                            RunSlideShow("productimg", "productimg_content","<%:p %>", <%:numImg %>);
                    </script>
                    <div class="div_RInfoProduct">
                        <div class="div_TopRIProduct productimg">
                            <div id="productimg_controls">
                            </div>
                            <div id="productimg_content">
                                <a href="">
                                    <img id="productimg" src="<%: firstP %>" width="480" height="234" border="0" /></a>
                            </div>
                        </div>
                        <div id="div_MainLIMG" class="div_listProduct" style="display: block;">
                            <div id="dFocusImgShow" class="dFocusImgShow" style="left: 6px;">
                            </div>
                            <div id="btnPreIMG" class="div_btListIMG buttonPre" style="display: block;">
                            </div>
                            <div id="btnNextIMG" class="div_btListIMG buttonNext" style="display: block;">
                            </div>
                            <div id="div_IMGList" class="div_MainListImgI">
                                <%int c = 0;
                                    foreach (var item in Model.hinhAnh)
                                  {%>
                                      <div id="dListImg_<%:c %>" class="listIMG imgListfirst">
                                            <img height="55" width="91" src="<%:item.URL %>"></div>                                
                                  <%c++;
                                      } %>
                                
                            </div>
                        </div>
                        <div class="div_HighLight">
                            <i class="div_TopHighLight"></i>
                            <div class="div_BodyHighLight" id="divDealInfo">
                                <div class="div_LBodyHL">
                                    <h4 class="styleText2 color16">
                                        Mô tả tóm tắt</h4>
                                    <br>
                                    <div class="styleText7 color3 pTextTopHL">
                                        <p>
                                            <%:Model.moTaTomTat %></p>
                                    </div>
                                </div>
                                <div class="div_RBodyHL">
                                    <h4 class="styleText2 color16">
                                        Điều kiện</h4>
                                    <div class="styleText7 color3 pTextTopHL">
                                        <p>
                                            <%: new HtmlString(Model.dieuKien) %></p>
                                    </div>
                                </div>
                            </div>
                            <i class="div_BTHighLight"></i>
                        </div>
                    </div>
                    <!--DIV Rignt info Product-->
                </div>
        </div>
    </div>
    </div>
    <div class="div_Company">
        <div class="div_TopCom">
        </div>
        <div class="div_bodyCom">
            <div class="div_titleCom">
                <div class="div_xinchao">
                </div>
                <div class="div_TextTitleCom ">
                    <h2 class="styleText9 color5">
                        Mô tả:</h2>
                </div>
            </div>
            <div class="div_infoShop" id="divCompanyInfoL">
                <p>
                    <%:Model.moTa %></p>
            </div>
            <div class="div_RinfoCom">
                <div class="div_RTopInfoCom">
                </div>
                <div class="div_RbodyICom" id="divCompanyInfoR">
                    <div class="div_RTitleCom">
                        <strong style="font-size: 18px;" class="styleText9 color6">
                            <%if (Model.doanhNghiep != null)
                              {%>
                            <%:Model.doanhNghiep.Ten_DoanhNghiep%>
                            <%}
                              else
                              {%>
                            Hot Mỗi Ngày
                            <%} %></strong></div>
                    <div class="div_RBodyCom">
                        <p>
                            <a target="_blank" href="<%if (Model.doanhNghiep != null)
                              {%>
                            <%:Model.doanhNghiep.WebSite%>
                            <%}
                              else
                              {%>
                            http://hotmoingay.somee.com
                            <%} %>"><strong style="font-size: 13px;"
                                class="color8 styleText10"><%if (Model.doanhNghiep != null)
                              {%>
                            <%:Model.doanhNghiep.WebSite%>
                            <%}
                              else
                              {%>
                            http://hotmoingay.somee.com
                            <%} %></strong></a></p>
                        <div class="color6 styleText10 pDiachiTest">
                            <span class="spnIconAddr"><strong>1</strong><i></i></span><div style="padding-top: 8px;">
                                <a class="Addr" title="1" href="http://www.diadiem.com/vn/vnMap.aspx?st=SaiGon&amp;h=1&amp;cID=040808030909"
                                    target="_blank">
                                    <%if (Model.doanhNghiep != null)
                                      {%>
                                    <%:Model.doanhNghiep.DiaChi %>
                                    <%}
                                      else
                                      {%>
                                    Trụ sở chính Hot Mỗi Ngày: 227 Nguyễn Văn Cừ, Quận 5.
                                    <%} %>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>                
            </div>
        </div>
        <div class="div_BotCom">
        </div>
    </div>
    <p style="clear: both; margin-bottom: 20px">
        <a href="/Coupon/ListAllCoupon">Trở lại danh sách</a>
    </p>
</asp:Content>
